﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/BackEndFashion.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Fashion.Models.Product>>" %>
<%@ Import Namespace="A" %>
<%@ Import Namespace="Fashion.Common.Const" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <th>Id</th>
            <th>Name</th>
            <th>Price</th>
            <th>Quantity</th>
            <th>Count View</th>
            <th>View Images</th>
            <th>View FrontEnd</th>
            <th>Date Time Create</th>
            <th></th>
        </tr>
        <%foreach (var product in Model){%>
            <tr>
                <td><%=product.Id %></td>
                <td><%=product.Name %></td>
                <td align="right"><%=product.Price.DisplayMoney() %> <%=product.Currency %></td>
                <td align="right"><%=product.Quantity %></td>
                <td align="right"><%=product.CountView %></td>
                <td align="right"><%=Html.ActionLink("View Images", "ViewImages", new { productId= product.Id })%></td>
                <td align="center">
                    <%=Html.ActionLink("View", "Detail", new { id = product.Id }, new {target="_blank"})%></td>
                <td><%=product.DateTimeCreate.DisplayDateTime()%></td>
                <td>
                    <%=Html.ActionLink(ParameterTemplate.Image,"Update",new {id = product.Id}).DisplayActionLinkByImage(HtmlCode.ImgIconEdit) %>
                    <%=Html.ActionLink(ParameterTemplate.Image, "Delete", new { id = product.Id, categoryId = product.CategoryId }, new { onclick = "return confirm('Are you sure you wish to delete this record?');" }).DisplayActionLinkByImage(HtmlCode.ImgIconDelete)%>
                </td>
            </tr>
        <%}%>
        <tr>
            <td colspan="9" align="right"><%=Html.ActionLink(ParameterTemplate.Image, "Create", new { categoryId = ViewData[ViewDataName.CategoryId] }).DisplayActionLinkByImage(HtmlCode.ImgIconAddNew)%></td>
        </tr>
    </table>
</asp:Content>
